import 'package:flutter/material.dart';
import 'package:flutter_demo/pages/squadron_worker_test/task/task_demo_1.dart';

/// 关于线程使用的另一种方案-squadron
class SquadronWorkerTest extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    _test1();
    return Scaffold(
        appBar: AppBar(
          title: Text("Worker Test"),
        ),
        body: Container());
  }

  Future<void> _test1() async {
    TaskDemo1Worker taskDemo1Worker = TaskDemo1Worker();
    debugPrint("@@@@@@-->任务开始-->");
    int result = await taskDemo1Worker.calcTest1("测试");
    debugPrint("@@@@@@-->任务执行完成-->$result");
    taskDemo1Worker.stop();
  }
}
